// 代码块
import {
  observable,
  action
} from 'mobx-miniprogram'
export const store = observable({
  //数据字段 - 类似于vuex中的state
  wordhistory:wx.getStorageSync('wordhistory')? JSON.parse(wx.getStorageSync('wordhistory')) : [],
  
  //actions
  updateword: action(function (wordhistory) {
    console.log(wordhistory);
    this.wordhistory=wordhistory
    wx.setStorageSync('wordhistory', JSON.stringify(wordhistory))
  })
})